package com.depin.pdaapp.http;


import com.depin.pdaapp.bean.UserBean;
import com.jaydenxiao.common.basebean.BaseRespose;
import com.jaydenxiao.common.baserx.RxSchedulers;

import rx.Observable;


public class NetBiz {

//    //登录
//    public Observable<LoginBean> login(String username, String password) {
//        return Api.getDefault(ApiConstants.TYPE_HOST)
//                .login(username, password)
//                .compose(RxSchedulers.<LoginBean>handleResult());
//
//    }


    public Observable<UserBean> Login(String account, String password, int type) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .Login(account, password, type)
                .compose(RxSchedulers.handleResult());
    }

    public Observable<BaseRespose> ScanIn(String qrcode, String in_time, String in_address) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .ScanIn(qrcode, in_time, in_address)
                .compose(RxSchedulers.io_main());
    }

    public Observable<BaseRespose> ScanOut(String qrcode, String out_time, String out_address) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .ScanOut(qrcode, out_time, out_address)
                .compose(RxSchedulers.io_main());
    }

    public Observable<BaseRespose> batch(String qrcode, String batch, String make_time) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .batch(qrcode, batch, make_time)
                .compose(RxSchedulers.io_main());
    }

    public Observable<BaseRespose> makeTime(String qrcode, String make_time) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .makeTime(qrcode, make_time)
                .compose(RxSchedulers.io_main());
    }

    public Observable<BaseRespose> wuliu(String qrcode, String province, String city, String district, String province1, String city1, String district1, String ship_address, String rec_address, String fh_time) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .wuliu(qrcode, province, city, district, province1, city1, district1, ship_address, rec_address, fh_time)
                .compose(RxSchedulers.io_main());
    }

    //    ship_address	否	string	发货详细地址
//    rec_address	否	string	收货详细地址
//    fh_time	否	string	发货时间
//    in_time	否	string	入库时间
//    in_address	否	string	入库地址
//    out_time	否	string	出库时间
//    out_address	否	string	出库地址
//    batch	否	string	生产批次
    public Observable<BaseRespose> allSave(String qrcode, String province, String city, String district, String province1, String city1, String district1, String ship_address, String rec_address, String fh_time, String in_time, String in_address, String out_time, String out_address, String batch) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .allSave(qrcode, province, city, district, province1, city1, district1, ship_address, rec_address, fh_time, in_time, in_address, out_time, out_address, batch)
                .compose(RxSchedulers.io_main());
    }

    public Observable<BaseRespose> zutao(String qrcode, String province, String city, String district, String province1, String city1, String district1, String ship_address, String rec_address, String in_time, String in_address, String out_time, String out_address, String batch,  String fh_time) {
        return Api.getDefault(ApiConstants.TYPE_HOST)
                .zutao(qrcode, province, city, district, province1, city1, district1, ship_address, rec_address, in_time, in_address, out_time, out_address, batch,  fh_time)
                .compose(RxSchedulers.io_main());
    }


}
